<!DOCTYPE html >
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
<title>登陆</title>

<link rel="stylesheet" href="statics/layui/css/layui.css" />
<link rel="stylesheet" href="css/admin/login.css" />

<!--<link href="css/bootstrap.min.css" title="" rel="stylesheet" />-->
<!--<link title="orange" href="css/login.css" rel="stylesheet" type="text/css"/>-->

<link type="text/css" rel="stylesheet" href="starFile/css/normalize.css" />
<link type="text/css" rel="stylesheet" href="starFile/css/demo.css" />
<!--必要样式-->
<link type="text/css" rel="stylesheet" href="starFile/css/component.css" />


</head>

<body>
  <div class="container demo-1">
	
		<div id="large-header" class="large-header">
			<canvas id="demo-canvas"></canvas>
			<div class="logo_box">
				<div style="height:1px;"></div>
				<div class="login" style="opacity:0.6;background: grey;" >
    				<div class="layadmin-user-login-main center" style="margin-top: -10px;background: grey;">
				<form id="login" class="layadmin-user-login-box layadmin-user-login-body layui-form" style="background: black;">
					<div class="layui-form-item" style="opacity: 1;">
						<div class="logo" style="opacity: 1;">
							<img src="img/yezi.png" style="width: 300px; height: 100px;"/>
						</div>
						<h3 class="title" style="margin-bottom:40px;">
							<img src="img/wenzi1.png"  />
						</h3>
					</div>
					<div class="layui-form-item" >
						<input name="username" lay-verify="required" placeholder="用户名" class="my-layui-input" type="text">
					</div>
					<div class="layui-form-item">
						<input name="password" lay-verify="required|password" placeholder="密码" class="my-layui-input" type="password">
					</div>
					<div class="layui-form-item">
						<input type="radio" name="type" value="ADMIN" title="管理员">
						<input type="radio" name="type" value="TEACHER" title="教师">
						<input type="radio" name="type" value="STUDENT" title="学生" checked>
					</div>
					<div class="layui-form-item">
						<button class="my-layui-btn" lay-submit lay-filter="LAY-user-login-submit">登 录</button>
					</div>
				</form>
			</div>
	 
  </div>
				
			</div>
		</div>
	
</div>
  
  
</body>



<script type="text/javascript" src="statics/layui/layui.js"></script>
<script type="text/javascript" src="statics/lay/system/admin/public.js"></script>
	
<script type="text/javascript" src="starFile/js/TweenLite.min.js"></script>
<script type="text/javascript" src="starFile/js/EasePack.min.js"></script>
<script type="text/javascript" src="starFile/js/rAF.js"></script>
<script type="text/javascript" src="starFile/js/demo-1.js"></script>

	<script type="text/javascript">
		layui.use(['layer', 'form', 'element', 'jquery'], function() {
			var layer = layui.layer,
				element = layui.element,
				form = layui.form,
				$ = layui.$;
			form.render();
			//提交
			form.on('submit(LAY-user-login-submit)', function(data) {
				var user_data = JSON.stringify(data.field);
				$.ajax({
					url: IP + '/api/teacher_eav/login',
					contentType: "application/x-www-form-urlencoded",
					headers: {
						'Authorization': ''
					},
					data: {
						username: $("input[name='username']").val()+"|"+$("input[name='type']:checked").val(),
						password: $("input[name='password']").val()
					},
					success: function(result, status, xhr) {
						layer.closeAll('loading');
						layer.msg("登录成功", {
							icon: 1,
							time: 1000
						}, function() {
							parent.window.location.href = 'index.html'
						});
					}
				});
				return false;
			});
			form.verify({
				password: [
					/^[\S]{5,12}$/, '密码必须5到12位，且不能出现空格'
				]
			});
			$(function() {
				$('#test').click(function() {
					refresh_token();
				})
			})
		});
	</script>
	
	<script>
	</script>
</html>